//SPDX-FileCopyrightText: Copyright 2022-2024 深圳市同心圆网络有限公司
//SPDX-License-Identifier: GPL-3.0-only

package org_dao

import "go.mongodb.org/mongo-driver/mongo"

var OrgInfoDao *_OrgInfoDao
var DepartMentDao *_DepartMentDao
var InviteDao *_InviteDao
var MemberDao *_MemberDao
var OkrDao *_OkrDao
var DayReportDao *_DayReportDao
var WeekReportDao *_WeekReportDao
var ForumDao *_ForumDao
var ForumThreadDao *_ForumThreadDao
var ThreadContentDao *_ThreadContentDao

func InitDao(mgoDb *mongo.Database) (err error) {
	OrgInfoDao, err = newOrgInfoDao(mgoDb)
	if err != nil {
		return
	}
	DepartMentDao, err = newDepartMentDao(mgoDb)
	if err != nil {
		return
	}
	InviteDao, err = newInviteDao(mgoDb)
	if err != nil {
		return
	}
	MemberDao, err = newMemberDao(mgoDb)
	if err != nil {
		return
	}
	OkrDao, err = newOkrDao(mgoDb)
	if err != nil {
		return
	}
	DayReportDao, err = newDayReportDao(mgoDb)
	if err != nil {
		return
	}
	WeekReportDao, err = newWeekReportDao(mgoDb)
	if err != nil {
		return
	}
	ForumDao, err = newForumDao(mgoDb)
	if err != nil {
		return
	}
	ForumThreadDao, err = newForumThreadDao(mgoDb)
	if err != nil {
		return
	}
	ThreadContentDao, err = newThreadContentDao(mgoDb)
	if err != nil {
		return
	}
	return
}
